package com.itheima.controller;

import com.itheima.pojo.Address;
import com.itheima.pojo.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class ResponseController {
    @RequestMapping("/hello")
    public Result hello(){
        System.out.println("hello java");
        return Result.success("hello java");
    }

    @RequestMapping("/listAddr")
    public Result listAddr1 (){
        List<Address> list = new ArrayList<>();
        Address address = new Address();
        address.setCity("成都");
        address.setProvince("四川");
        list.add(address);
        return Result.success(list);

    }
}
